package com.molyfun.parents.activity.coursecenter.model;

import android.os.Parcel;
import android.os.Parcelable;

import com.molyfun.parents.rest.BaseListResponse;
import com.molyfun.parents.rest.bean.TeacherDetailResponse;

import java.util.List;

/**
 * Created by william(liuchao.hit@gmail.com).
 * Date:10/31/16.
 */
public class SubjectListResponse extends BaseListResponse<SubjectListResponse.SubjectBrief> {

    public static class SubjectBrief implements Parcelable {


        /**
         * id : 4028b8816163b3fa016163c89793005e
         * name : 哈哈哈哈哈
         * begindatetime : -28800000
         * enddatetime : -28800000
         * price : 100000
         * sellcount : 0
         * introduce : 买不起了吧
         * userlist : [{"id":"4028b8815f27e7bf015f29941b8a030c","username":"gg","headimgurl":"http://media.molyfun.com/mf/user/ic_20171017-170425.jpg?imageMogr2/thumbnail/300x300","resume":"","skills":"","post":null,"experience":"","training":"","sample":"","certlist":[],"customstatus":null,"rolename":"主管(测试机构)"}]
         * degree : 0
         * commenttimes : 0
         * medianum : 1
         * livenum : 2
         */

        private String id;
        private String name;
        private long begindatetime;
        private long enddatetime;
        private double price;
        private int sellcount;
        private String introduce;
        private String degree;
        private int commenttimes;
        private int medianum;
        private int livenum;
        private List<TeacherDetailResponse.TeacherDetailBean> userlist;
        /**
         * live 表示正在直播
         */
        private String livestatus;

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public long getBegindatetime() {
            return begindatetime;
        }

        public void setBegindatetime(long begindatetime) {
            this.begindatetime = begindatetime;
        }

        public long getEnddatetime() {
            return enddatetime;
        }

        public void setEnddatetime(long enddatetime) {
            this.enddatetime = enddatetime;
        }

        public double getPrice() {
            return price;
        }

        public void setPrice(int price) {
            this.price = price;
        }

        public int getSellcount() {
            return sellcount;
        }

        public void setSellcount(int sellcount) {
            this.sellcount = sellcount;
        }

        public String getIntroduce() {
            return introduce;
        }

        public void setIntroduce(String introduce) {
            this.introduce = introduce;
        }

        public String getDegree() {
            return degree;
        }

        public void setDegree(String degree) {
            this.degree = degree;
        }

        public int getCommenttimes() {
            return commenttimes;
        }

        public void setCommenttimes(int commenttimes) {
            this.commenttimes = commenttimes;
        }

        public int getMedianum() {
            return medianum;
        }

        public void setMedianum(int medianum) {
            this.medianum = medianum;
        }

        public int getLivenum() {
            return livenum;
        }

        public void setLivenum(int livenum) {
            this.livenum = livenum;
        }

        public List<TeacherDetailResponse.TeacherDetailBean> getUserlist() {
            return userlist;
        }

        public void setUserlist(List<TeacherDetailResponse.TeacherDetailBean> userlist) {
            this.userlist = userlist;
        }

        public String getLivestatus() {
            return livestatus;
        }

        public void setLivestatus(String livestatus) {
            this.livestatus = livestatus;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.id);
            dest.writeString(this.name);
            dest.writeLong(this.begindatetime);
            dest.writeLong(this.enddatetime);
            dest.writeDouble(this.price);
            dest.writeInt(this.sellcount);
            dest.writeString(this.introduce);
            dest.writeString(this.degree);
            dest.writeInt(this.commenttimes);
            dest.writeInt(this.medianum);
            dest.writeInt(this.livenum);
            dest.writeTypedList(this.userlist);
            dest.writeString(this.livestatus);
        }

        public SubjectBrief() {
        }

        protected SubjectBrief(Parcel in) {
            this.id = in.readString();
            this.name = in.readString();
            this.begindatetime = in.readLong();
            this.enddatetime = in.readLong();
            this.price = in.readDouble();
            this.sellcount = in.readInt();
            this.introduce = in.readString();
            this.degree = in.readString();
            this.commenttimes = in.readInt();
            this.medianum = in.readInt();
            this.livenum = in.readInt();
            this.userlist = in.createTypedArrayList(TeacherDetailResponse.TeacherDetailBean.CREATOR);
            this.livestatus = in.readString();
        }

        public static final Parcelable.Creator<SubjectBrief> CREATOR = new Parcelable.Creator<SubjectBrief>() {
            @Override
            public SubjectBrief createFromParcel(Parcel source) {
                return new SubjectBrief(source);
            }

            @Override
            public SubjectBrief[] newArray(int size) {
                return new SubjectBrief[size];
            }
        };
    }

}
